home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Components.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  24.2 KB  |  831 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Components.a
  3. ;
  4. ;    Contains:    Component Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1991-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  19. __COMPONENTS__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  28.     include 'MixedMode.a'
  29.     ENDIF
  30.  
  31.  
  32. kAppleManufacturer                EQU        'appl'                ; Apple supplied components 
  33. kComponentResourceType            EQU        'thng'                ; a components resource type 
  34.  
  35. kAnyComponentType                EQU        0
  36. kAnyComponentSubType            EQU        0
  37. kAnyComponentManufacturer        EQU        0
  38. kAnyComponentFlagsMask            EQU        0
  39.  
  40. cmpWantsRegisterMessage            EQU        $80000000
  41.  
  42. kComponentOpenSelect            EQU        -1                    ; ComponentInstance for this open 
  43. kComponentCloseSelect            EQU        -2                    ; ComponentInstance for this close 
  44. kComponentCanDoSelect            EQU        -3                    ; selector # being queried 
  45. kComponentVersionSelect            EQU        -4                    ; no params 
  46. kComponentRegisterSelect        EQU        -5                    ; no params 
  47. kComponentTargetSelect            EQU        -6                    ; ComponentInstance for top of call chain 
  48. kComponentUnregisterSelect        EQU        -7                    ; no params 
  49. kComponentGetMPWorkFunctionSelect EQU    -8                    ; some params 
  50. ;  Component Resource Extension flags 
  51.  
  52. componentDoAutoVersion            EQU        $01
  53. componentWantsUnregister        EQU        $02
  54. componentAutoVersionIncludeFlags EQU    $04
  55. componentHasMultiplePlatforms    EQU        $08
  56.  
  57.  
  58. ;  Set Default Component flags 
  59.  
  60. defaultComponentIdentical        EQU        0
  61. defaultComponentAnyFlags        EQU        1
  62. defaultComponentAnyManufacturer    EQU        2
  63. defaultComponentAnySubType        EQU        4
  64. defaultComponentAnyFlagsAnyManufacturer EQU 3
  65. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU 7
  66. ;  RegisterComponentResource flags 
  67.  
  68. registerComponentGlobal            EQU        1
  69. registerComponentNoDuplicates    EQU        2
  70. registerComponentAfterExisting    EQU        4
  71.  
  72. ComponentDescription    RECORD 0
  73. componentType             ds.l    1                ; offset: $0 (0)        ;  A unique 4-byte code indentifying the command set 
  74. componentSubType         ds.l    1                ; offset: $4 (4)        ;  Particular flavor of this instance 
  75. componentManufacturer     ds.l    1                ; offset: $8 (8)        ;  Vendor indentification 
  76. componentFlags             ds.l    1                ; offset: $C (12)        ;  8 each for Component,Type,SubType,Manuf/revision 
  77. componentFlagsMask         ds.l    1                ; offset: $10 (16)        ;  Mask for specifying which flags to consider in search, zero during registration 
  78. sizeof                     EQU *                    ; size:   $14 (20)
  79.                         ENDR
  80.  
  81. ResourceSpec            RECORD 0
  82. resType                     ds.l    1                ; offset: $0 (0)        ;  4-byte code  
  83. resID                     ds.w    1                ; offset: $4 (4)        ;               
  84. sizeof                     EQU *                    ; size:   $6 (6)
  85.                         ENDR
  86. ComponentResource        RECORD 0
  87. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  Registration parameters 
  88. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  89. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  90. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  91. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  92. sizeof                     EQU *                    ; size:   $2C (44)
  93.                         ENDR
  94. ; typedef struct ComponentResource *    ComponentResourcePtr
  95.  
  96. ; typedef ComponentResourcePtr *        ComponentResourceHandle
  97.  
  98. ComponentPlatformInfo    RECORD 0
  99. componentFlags             ds.l    1                ; offset: $0 (0)        ;  flags of Component 
  100. component                 ds        ResourceSpec    ; offset: $4 (4)        ;  resource where Component code is found 
  101. platformType             ds.w    1                ; offset: $A (10)        ;  gestaltSysArchitecture result 
  102. sizeof                     EQU *                    ; size:   $C (12)
  103.                         ENDR
  104. ComponentResourceExtension RECORD 0
  105. componentVersion         ds.l    1                ; offset: $0 (0)        ;  version of Component 
  106. componentRegisterFlags     ds.l    1                ; offset: $4 (4)        ;  flags for registration 
  107. componentIconFamily         ds.w    1                ; offset: $8 (8)        ;  resource id of Icon Family 
  108. sizeof                     EQU *                    ; size:   $A (10)
  109.                         ENDR
  110. ComponentPlatformInfoArray RECORD 0
  111. count                     ds.l    1                ; offset: $0 (0)
  112. platformArray             ds        ComponentPlatformInfo ; offset: $4 (4) <-- really an array of length one
  113. sizeof                     EQU *                    ; size:   $10 (16)
  114.                         ENDR
  115. ExtComponentResource    RECORD 0
  116. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  registration parameters 
  117. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  118. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  119. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  120. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  121. componentVersion         ds.l    1                ; offset: $2C (44)        ;  version of Component 
  122. componentRegisterFlags     ds.l    1                ; offset: $30 (48)        ;  flags for registration 
  123. componentIconFamily         ds.w    1                ; offset: $34 (52)        ;  resource id of Icon Family 
  124. count                     ds.l    1                ; offset: $36 (54)        ;  elements in platformArray 
  125. platformArray             ds        ComponentPlatformInfo ; offset: $3A (58) <-- really an array of length one
  126. sizeof                     EQU *                    ; size:   $46 (70)
  127.                         ENDR
  128. ;   Structure received by Component:        
  129. ComponentParameters        RECORD 0
  130. flags                     ds.b    1                ; offset: $0 (0)        ;  call modifiers: sync/async, deferred, immed, etc 
  131. paramSize                 ds.b    1                ; offset: $1 (1)        ;  size in bytes of actual parameters passed to this call 
  132. what                     ds.w    1                ; offset: $2 (2)        ;  routine selector, negative for Component management calls 
  133. params                     ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  actual parameters for the indicated routine 
  134. sizeof                     EQU *                    ; size:   $8 (8)
  135.                         ENDR
  136. ComponentRecord            RECORD 0
  137. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  138. sizeof                     EQU *                    ; size:   $4 (4)
  139.                         ENDR
  140. ; typedef struct ComponentRecord *        Component
  141.  
  142. ComponentInstanceRecord    RECORD 0
  143. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  144. sizeof                     EQU *                    ; size:   $4 (4)
  145.                         ENDR
  146. ; typedef struct ComponentInstanceRecord * ComponentInstance
  147.  
  148. RegisteredComponentRecord RECORD 0
  149. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  150. sizeof                     EQU *                    ; size:   $4 (4)
  151.                         ENDR
  152. RegisteredComponentInstanceRecord RECORD 0
  153. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  154. sizeof                     EQU *                    ; size:   $4 (4)
  155.                         ENDR
  156. ; typedef struct RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr
  157.  
  158. ; typedef long                             ComponentResult
  159.  
  160.  
  161. mpWorkFlagDoWork                EQU        $01
  162. mpWorkFlagDoCompletion            EQU        $02
  163. mpWorkFlagCopyWorkBlock            EQU        $04
  164. mpWorkFlagDontBlock                EQU        $08
  165. mpWorkFlagGetProcessorCount        EQU        $10
  166. mpWorkFlagGetIsRunning            EQU        $40
  167. ComponentMPWorkFunctionHeaderRecord RECORD 0
  168. headerSize                 ds.l    1                ; offset: $0 (0)
  169. recordSize                 ds.l    1                ; offset: $4 (4)
  170. workFlags                 ds.l    1                ; offset: $8 (8)
  171. processorCount             ds.w    1                ; offset: $C (12)
  172. unused                     ds.b    1                ; offset: $E (14)
  173. isRunning                 ds.b    1                ; offset: $F (15)
  174. sizeof                     EQU *                    ; size:   $10 (16)
  175.                         ENDR
  176. ; typedef struct ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr
  177.  
  178. ;    The parameter list for each ComponentFunction is unique. It is
  179. ;    therefore up to users to create the appropriate procInfo for their
  180. ;    own ComponentFunctions where necessary.
  181. ;
  182.  
  183. ; typedef UniversalProcPtr                 ComponentFunctionUPP
  184.  
  185.  
  186. ; ********************************************************
  187. ;*                                                        *
  188. ;*                  APPLICATION LEVEL CALLS                    *
  189. ;*                                                        *
  190. ;*******************************************************
  191.  
  192. ; ********************************************************
  193. ;* Component Database Add, Delete, and Query Routines
  194. ;*******************************************************
  195.  
  196. ;
  197. ; pascal Component RegisterComponent(ComponentDescription *cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
  198. ;
  199.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  200.         Macro
  201.         _RegisterComponent
  202.             moveq               #1,D0
  203.             dc.w                $A82A
  204.         EndM
  205.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  206.         IMPORT_CFM_FUNCTION RegisterComponent
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal Component RegisterComponentResource(ComponentResourceHandle cr, short global)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  213.         Macro
  214.         _RegisterComponentResource
  215.             moveq               #18,D0
  216.             dc.w                $A82A
  217.         EndM
  218.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION RegisterComponentResource
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal OSErr UnregisterComponent(Component aComponent)
  224. ;
  225.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  226.         Macro
  227.         _UnregisterComponent
  228.             moveq               #2,D0
  229.             dc.w                $A82A
  230.         EndM
  231.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  232.         IMPORT_CFM_FUNCTION UnregisterComponent
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
  237. ;
  238.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  239.         Macro
  240.         _FindNextComponent
  241.             moveq               #4,D0
  242.             dc.w                $A82A
  243.         EndM
  244.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  245.         IMPORT_CFM_FUNCTION FindNextComponent
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal long CountComponents(ComponentDescription *looking)
  250. ;
  251.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  252.         Macro
  253.         _CountComponents
  254.             moveq               #3,D0
  255.             dc.w                $A82A
  256.         EndM
  257.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION CountComponents
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *cd, Handle componentName, Handle componentInfo, Handle componentIcon)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  265.         Macro
  266.         _GetComponentInfo
  267.             moveq               #5,D0
  268.             dc.w                $A82A
  269.         EndM
  270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION GetComponentInfo
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal long GetComponentListModSeed(void )
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         Macro
  279.         _GetComponentListModSeed
  280.             moveq               #6,D0
  281.             dc.w                $A82A
  282.         EndM
  283.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION GetComponentListModSeed
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal long GetComponentTypeModSeed(OSType componentType)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         Macro
  292.         _GetComponentTypeModSeed
  293.             moveq               #44,D0
  294.             dc.w                $A82A
  295.         EndM
  296.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION GetComponentTypeModSeed
  298.     ENDIF
  299.  
  300. ; ********************************************************
  301. ;* Component Instance Allocation and dispatch routines
  302. ;*******************************************************
  303.  
  304. ;
  305. ; pascal OSErr OpenAComponent(Component aComponent, ComponentInstance *ci)
  306. ;
  307.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  308.         Macro
  309.         _OpenAComponent
  310.             moveq               #45,D0
  311.             dc.w                $A82A
  312.         EndM
  313.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  314.         IMPORT_CFM_FUNCTION OpenAComponent
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal ComponentInstance OpenComponent(Component aComponent)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  321.         Macro
  322.         _OpenComponent
  323.             moveq               #7,D0
  324.             dc.w                $A82A
  325.         EndM
  326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION OpenComponent
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         Macro
  335.         _CloseComponent
  336.             moveq               #8,D0
  337.             dc.w                $A82A
  338.         EndM
  339.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  340.         IMPORT_CFM_FUNCTION CloseComponent
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
  345. ;
  346.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  347.         Macro
  348.         _GetComponentInstanceError
  349.             moveq               #10,D0
  350.             dc.w                $A82A
  351.         EndM
  352.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  353.         IMPORT_CFM_FUNCTION GetComponentInstanceError
  354.     ENDIF
  355.  
  356. ; ********************************************************
  357. ;*                                                        *
  358. ;*                      CALLS MADE BY COMPONENTS              *
  359. ;*                                                        *
  360. ;*******************************************************
  361.  
  362. ; ********************************************************
  363. ;* Component Management routines
  364. ;*******************************************************
  365.  
  366. ;
  367. ; pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
  368. ;
  369.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  370.         Macro
  371.         _SetComponentInstanceError
  372.             moveq               #11,D0
  373.             dc.w                $A82A
  374.         EndM
  375.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  376.         IMPORT_CFM_FUNCTION SetComponentInstanceError
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal long GetComponentRefcon(Component aComponent)
  381. ;
  382.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  383.         Macro
  384.         _GetComponentRefcon
  385.             moveq               #16,D0
  386.             dc.w                $A82A
  387.         EndM
  388.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  389.         IMPORT_CFM_FUNCTION GetComponentRefcon
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal void SetComponentRefcon(Component aComponent, long theRefcon)
  394. ;
  395.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  396.         Macro
  397.         _SetComponentRefcon
  398.             moveq               #17,D0
  399.             dc.w                $A82A
  400.         EndM
  401.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION SetComponentRefcon
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal short OpenComponentResFile(Component aComponent)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         Macro
  410.         _OpenComponentResFile
  411.             moveq               #21,D0
  412.             dc.w                $A82A
  413.         EndM
  414.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION OpenComponentResFile
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal OSErr OpenAComponentResFile(Component aComponent, short *resRef)
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  422.         Macro
  423.         _OpenAComponentResFile
  424.             moveq               #47,D0
  425.             dc.w                $A82A
  426.         EndM
  427.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  428.         IMPORT_CFM_FUNCTION OpenAComponentResFile
  429.     ENDIF
  430.  
  431. ;
  432. ; pascal OSErr CloseComponentResFile(short refnum)
  433. ;
  434.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  435.         Macro
  436.         _CloseComponentResFile
  437.             moveq               #24,D0
  438.             dc.w                $A82A
  439.         EndM
  440.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  441.         IMPORT_CFM_FUNCTION CloseComponentResFile
  442.     ENDIF
  443.  
  444. ; ********************************************************
  445. ;* Component Instance Management routines
  446. ;*******************************************************
  447.  
  448. ;
  449. ; pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
  450. ;
  451.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  452.         Macro
  453.         _GetComponentInstanceStorage
  454.             moveq               #12,D0
  455.             dc.w                $A82A
  456.         EndM
  457.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  458.         IMPORT_CFM_FUNCTION GetComponentInstanceStorage
  459.     ENDIF
  460.  
  461. ;
  462. ; pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  465.         Macro
  466.         _SetComponentInstanceStorage
  467.             moveq               #13,D0
  468.             dc.w                $A82A
  469.         EndM
  470.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  471.         IMPORT_CFM_FUNCTION SetComponentInstanceStorage
  472.     ENDIF
  473.  
  474. ;
  475. ; pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
  476. ;
  477.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  478.         Macro
  479.         _GetComponentInstanceA5
  480.             moveq               #14,D0
  481.             dc.w                $A82A
  482.         EndM
  483.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  484.         IMPORT_CFM_FUNCTION GetComponentInstanceA5
  485.     ENDIF
  486.  
  487. ;
  488. ; pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
  489. ;
  490.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  491.         Macro
  492.         _SetComponentInstanceA5
  493.             moveq               #15,D0
  494.             dc.w                $A82A
  495.         EndM
  496.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  497.         IMPORT_CFM_FUNCTION SetComponentInstanceA5
  498.     ENDIF
  499.  
  500. ;
  501. ; pascal long CountComponentInstances(Component aComponent)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  504.         Macro
  505.         _CountComponentInstances
  506.             moveq               #19,D0
  507.             dc.w                $A82A
  508.         EndM
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION CountComponentInstances
  511.     ENDIF
  512.  
  513. ;  useful helper routines for convenient method dispatching 
  514. ;
  515. ; pascal long CallComponentFunction(ComponentParameters *params, ComponentFunctionUPP func)
  516. ;
  517.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  518.         Macro
  519.         _CallComponentFunction
  520.             moveq               #-1,D0
  521.             dc.w                $A82A
  522.         EndM
  523.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION CallComponentFunction
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunctionUPP func)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  531.         Macro
  532.         _CallComponentFunctionWithStorage
  533.             moveq               #-1,D0
  534.             dc.w                $A82A
  535.         EndM
  536.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorage
  538.     ENDIF
  539.  
  540.     IF TARGET_CPU_PPC THEN
  541. ;
  542. ; pascal long CallComponentFunctionWithStorageProcInfo(Handle storage, ComponentParameters *params, ProcPtr func, long funcProcInfo)
  543. ;
  544.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  545.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorageProcInfo
  546.     ENDIF
  547.  
  548.     ELSE
  549.     ENDIF    ; TARGET_CPU_PPC
  550. ;
  551. ; pascal long DelegateComponentCall(ComponentParameters *originalParams, ComponentInstance ci)
  552. ;
  553.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  554.         Macro
  555.         _DelegateComponentCall
  556.             moveq               #36,D0
  557.             dc.w                $A82A
  558.         EndM
  559.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  560.         IMPORT_CFM_FUNCTION DelegateComponentCall
  561.     ENDIF
  562.  
  563. ;
  564. ; pascal OSErr SetDefaultComponent(Component aComponent, short flags)
  565. ;
  566.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  567.         Macro
  568.         _SetDefaultComponent
  569.             moveq               #30,D0
  570.             dc.w                $A82A
  571.         EndM
  572.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  573.         IMPORT_CFM_FUNCTION SetDefaultComponent
  574.     ENDIF
  575.  
  576. ;
  577. ; pascal ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType)
  578. ;
  579.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  580.         Macro
  581.         _OpenDefaultComponent
  582.             moveq               #33,D0
  583.             dc.w                $A82A
  584.         EndM
  585.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  586.         IMPORT_CFM_FUNCTION OpenDefaultComponent
  587.     ENDIF
  588.  
  589. ;
  590. ; pascal OSErr OpenADefaultComponent(OSType componentType, OSType componentSubType, ComponentInstance *ci)
  591. ;
  592.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  593.         Macro
  594.         _OpenADefaultComponent
  595.             moveq               #46,D0
  596.             dc.w                $A82A
  597.         EndM
  598.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  599.         IMPORT_CFM_FUNCTION OpenADefaultComponent
  600.     ENDIF
  601.  
  602. ;
  603. ; pascal Component CaptureComponent(Component capturedComponent, Component capturingComponent)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  606.         Macro
  607.         _CaptureComponent
  608.             moveq               #28,D0
  609.             dc.w                $A82A
  610.         EndM
  611.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION CaptureComponent
  613.     ENDIF
  614.  
  615. ;
  616. ; pascal OSErr UncaptureComponent(Component aComponent)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  619.         Macro
  620.         _UncaptureComponent
  621.             moveq               #29,D0
  622.             dc.w                $A82A
  623.         EndM
  624.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  625.         IMPORT_CFM_FUNCTION UncaptureComponent
  626.     ENDIF
  627.  
  628. ;
  629. ; pascal long RegisterComponentResourceFile(short resRefNum, short global)
  630. ;
  631.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  632.         Macro
  633.         _RegisterComponentResourceFile
  634.             moveq               #20,D0
  635.             dc.w                $A82A
  636.         EndM
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION RegisterComponentResourceFile
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal OSErr GetComponentIconSuite(Component aComponent, Handle *iconSuite)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  645.         Macro
  646.         _GetComponentIconSuite
  647.             moveq               #41,D0
  648.             dc.w                $A82A
  649.         EndM
  650.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  651.         IMPORT_CFM_FUNCTION GetComponentIconSuite
  652.     ENDIF
  653.  
  654.  
  655. ; ********************************************************
  656. ;*                                                        *
  657. ;*              Direct calls to the Components                *
  658. ;*                                                        *
  659. ;*******************************************************
  660.  
  661. ;  Old style names
  662.  
  663. ;
  664. ; pascal long ComponentFunctionImplemented(ComponentInstance ci, short ftnNumber)
  665. ;
  666.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  667.         Macro
  668.         _ComponentFunctionImplemented
  669.             move.l              #$0002FFFD,-(sp)
  670.             moveq               #0,D0
  671.             dc.w                $A82A
  672.         EndM
  673.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  674.         IMPORT_CFM_FUNCTION ComponentFunctionImplemented
  675.     ENDIF
  676.  
  677. ;
  678. ; pascal long GetComponentVersion(ComponentInstance ci)
  679. ;
  680.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  681.         Macro
  682.         _GetComponentVersion
  683.             move.l              #$0000FFFC,-(sp)
  684.             moveq               #0,D0
  685.             dc.w                $A82A
  686.         EndM
  687.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  688.         IMPORT_CFM_FUNCTION GetComponentVersion
  689.     ENDIF
  690.  
  691. ;
  692. ; pascal long ComponentSetTarget(ComponentInstance ci, ComponentInstance target)
  693. ;
  694.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  695.         Macro
  696.         _ComponentSetTarget
  697.             move.l              #$0004FFFA,-(sp)
  698.             moveq               #0,D0
  699.             dc.w                $A82A
  700.         EndM
  701.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  702.         IMPORT_CFM_FUNCTION ComponentSetTarget
  703.     ENDIF
  704.  
  705. ;  New style names
  706.  
  707. ;
  708. ; pascal ComponentResult CallComponentOpen(ComponentInstance ci, ComponentInstance self)
  709. ;
  710.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  711.         Macro
  712.         _CallComponentOpen
  713.             move.l              #$0004FFFF,-(sp)
  714.             moveq               #0,D0
  715.             dc.w                $A82A
  716.         EndM
  717.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  718.         IMPORT_CFM_FUNCTION CallComponentOpen
  719.     ENDIF
  720.  
  721. ;
  722. ; pascal ComponentResult CallComponentClose(ComponentInstance ci, ComponentInstance self)
  723. ;
  724.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  725.         Macro
  726.         _CallComponentClose
  727.             move.l              #$0004FFFE,-(sp)
  728.             moveq               #0,D0
  729.             dc.w                $A82A
  730.         EndM
  731.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  732.         IMPORT_CFM_FUNCTION CallComponentClose
  733.     ENDIF
  734.  
  735. ;
  736. ; pascal ComponentResult CallComponentCanDo(ComponentInstance ci, short ftnNumber)
  737. ;
  738.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  739.         Macro
  740.         _CallComponentCanDo
  741.             move.l              #$0002FFFD,-(sp)
  742.             moveq               #0,D0
  743.             dc.w                $A82A
  744.         EndM
  745.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  746.         IMPORT_CFM_FUNCTION CallComponentCanDo
  747.     ENDIF
  748.  
  749. ;
  750. ; pascal ComponentResult CallComponentVersion(ComponentInstance ci)
  751. ;
  752.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  753.         Macro
  754.         _CallComponentVersion
  755.             move.l              #$0000FFFC,-(sp)
  756.             moveq               #0,D0
  757.             dc.w                $A82A
  758.         EndM
  759.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  760.         IMPORT_CFM_FUNCTION CallComponentVersion
  761.     ENDIF
  762.  
  763. ;
  764. ; pascal ComponentResult CallComponentRegister(ComponentInstance ci)
  765. ;
  766.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  767.         Macro
  768.         _CallComponentRegister
  769.             move.l              #$0000FFFB,-(sp)
  770.             moveq               #0,D0
  771.             dc.w                $A82A
  772.         EndM
  773.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  774.         IMPORT_CFM_FUNCTION CallComponentRegister
  775.     ENDIF
  776.  
  777. ;
  778. ; pascal ComponentResult CallComponentTarget(ComponentInstance ci, ComponentInstance target)
  779. ;
  780.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  781.         Macro
  782.         _CallComponentTarget
  783.             move.l              #$0004FFFA,-(sp)
  784.             moveq               #0,D0
  785.             dc.w                $A82A
  786.         EndM
  787.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  788.         IMPORT_CFM_FUNCTION CallComponentTarget
  789.     ENDIF
  790.  
  791. ;
  792. ; pascal ComponentResult CallComponentUnregister(ComponentInstance ci)
  793. ;
  794.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  795.         Macro
  796.         _CallComponentUnregister
  797.             move.l              #$0000FFF9,-(sp)
  798.             moveq               #0,D0
  799.             dc.w                $A82A
  800.         EndM
  801.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  802.         IMPORT_CFM_FUNCTION CallComponentUnregister
  803.     ENDIF
  804.  
  805. ;
  806. ; pascal ComponentResult CallComponentGetMPWorkFunction(ComponentInstance ci, ComponentMPWorkFunctionUPP *workFunction, void **refCon)
  807. ;
  808.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  809.         Macro
  810.         _CallComponentGetMPWorkFunction
  811.             move.l              #$0008FFF8,-(sp)
  812.             moveq               #0,D0
  813.             dc.w                $A82A
  814.         EndM
  815.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  816.         IMPORT_CFM_FUNCTION CallComponentGetMPWorkFunction
  817.     ENDIF
  818.  
  819.  
  820. ;  UPP call backs 
  821. ;  ProcInfos 
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.     ENDIF ; __COMPONENTS__ 
  829.  
  830.